#include<vector>
#include<iostream>
using namespace std;
//力扣题解
//搜索二维矩阵
class Solution
{
public:
    bool searchMatrix(vector<vector<int>> &matrix, int target)
    {
        // bool flag = true;
        int length1 = matrix.size();
        int length2 = matrix[0].size();
        for(int i = 0; i < length1; i++)
        {
            for(int j = 0; j < length2; j++)
            {
                if(matrix[i][j] == target )
                {
                    // flag = false;
                    return true;
                }
            }
        }
        return false;
    }
};
//最大升序
class Solution
{
public:
    int maxAscendingSum(vector<int> &nums)
    {
        int max = 0;
        int sum = 0;
        int temp = nums[0];
        for (auto i = 0; i < nums.size(); i++)
        {
            if (nums[i] > temp)
            {
                temp = nums[i];
                sum += temp;
            }
            else
            {
                if (max < sum)
                {
                    max = sum;
                }
                temp = nums[i];
                sum = temp;
            }
        }
        if (max < sum)
        {
            max = sum;
        }
        return max;
    }
};
//a+b
class Solution
{
public:
    vector<int> twoSum(vector<int> &nums, int target)
    {
        int a,b;
        bool flag = false;
        for (int i = 0; i < nums.size(); i++)
        {
            int temp = target - nums[i];
            for (int j = i+1; j < nums.size(); j++)
            {
                if (nums[j] == temp)
                {
                    a = i;
                    b = j;
                    flag = true;
                    break;
                }
            }
            if(flag)
            break;
        }
        return {a,b};
    }
};

int main(void)
{
    return 0;
}